<style>
.myinfo-main .myinfo-right .myprofile ul li .lab {
    text-align: right;
}
.myinfo-main .myinfo-right .myprofile ul li {
    width: 620px;
}
.myinfo-main .myinfo-right .myprofile ul li .inp {
    margin-left: 10px;
}
.submit-btn {
    margin-left: 200px;
}
.myinfo-main .myinfo-right .myprofile .password-but {
    margin-left: 200px;
}
</style>
<div class="myinfo-main">
	
	<div class="myinfo-right">
		<div class='myprofile'>
			<p class='title'>&nbsp;&nbsp;Change Password</p>
			<?php $form=$this->beginWidget('CActiveForm', array(
						'id'=>'user-pass',
						// Please note: When you enable ajax validation, make sure the corresponding
						// controller action is handling ajax validation correctly.
						// There is a call to performAjaxValidation() commented in generated controller code.
						// See class documentation of CActiveForm for details on this.
						'enableAjaxValidation'=>true,
		)); ?>
			<ul class='info-left'>
				<li><?php echo $form->labelEx($model,'Old password:',array("class"=>"lab")); ?>
					<span class="inp"><?php echo $form->passwordField($model,'oldpass',array('size'=>20,'maxlength'=>20,'class'=>'form-control')); ?></span>
					<?php echo $form->error($model,'user_name'); ?>
				</li>
				<li><?php echo $form->labelEx($model,'New password:',array("class"=>"lab")); ?>
					<span class="inp"><?php echo $form->passwordField($model,'newpass',array('size'=>20,'maxlength'=>20,'class'=>'form-control')); ?></span>
					<?php echo $form->error($model,'created'); ?>
				</li>
				<li><?php echo $form->labelEx($model,'Confirm password:',array("class"=>"lab")); ?>
					<span class="inp"><?php echo $form->passwordField($model,'conpass',array('size'=>20,'maxlength'=>20,'class'=>'form-control')); ?></span>
				</li>
				 	<?php $this->endWidget(); ?>
				 	
			
			</ul>

			<p  class="password-but"><button class="btn btn-bid-auction" onclick=update()>confirm</button></p>


		</div>
		
	</div>
</div>
<script type="text/javascript">
function update(){
	var data=new Array();
	data.push($("#Customer_oldpass").val());
	data.push($("#Customer_newpass").val());
	data.push($("#Customer_conpass").val());

	$.post('<?php echo Yii::app()->baseUrl?>/myaccount/ajaxchangepass',{'Customer':data},function(data){
		alert(data);
	})
}



</script>